#include <stdio.h>
#include "h/part.h"

void report_count(void);

int count;

int main(void)
{
    int value;
    int i;

    printf("Please enter a positive integer (0 to quit):\n");
    while (scanf("%d", &value) == 1 && value > 0)
    {
        ++count;
        for (i=value; i>=0; i--)
            accumulate(i);

        printf("Please enter a positive integer:\n");
    }

    report_count();
    return 0;
}

void report_count(void)
{
    printf("Loop executed %d times.\n", count);
}
